package org.zhucy.design.factory;

/**
 * Created by zcy on 2018/1/25.
 * 工厂模式
 * @version 1.0
 */
public class PeopleFactory {

    public static Object getPeople(Class<? extends People> clazz){
        Object object = null;
        try {
            object = Class.forName(clazz.getName()).newInstance();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return object;
    }
}
